<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--md5工具类-->
    <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>


</head>
<body>
<form acton="post">
    <p>
        <span>用户名:</span><input type="text" id="username" name="username">
    </p>
    <p>
        <span>密码:</span><input type="password" id="input-password">
    </p>
    <!--这里是用md5加密后的密码, 往后端提交的就是这个-->
    <input type="hidden" id="md5-password" name="password">
<!--    <input type="submit">-->
<!--    给这个提交绑定一些事件-->
    <button type="submit" onclick="aaa()">提交</button>
</form>
<script>
    function aaa() {
        let username = document.getElementById('username');
        let input_pwd = document.getElementById('input-password');
        let md5_pwd = document.getElementById('md5-password');
        console.log(username);
        md5_pwd.value = md5(input_pwd.value);//md5_pwd是我们自己用input_pwd填的
        console.log(input_pwd);
        console.log(md5_pwd);

    }
</script>


</body>
</html>